Skip to content

GGUF-packed follow-ups: utf-8 for the dense writer JSON, the real packed check in the loader fixture, hint check per failure path (red on main since #20022) - #20078

Merged
danielhanchen merged 1 commit into
mainfrom
ci-gguf-packed-followups
Nov 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-gguf-packed-followups

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Three more checks in Repo tests (CPU, rest) have been red on main since #20022 (Train LoRA on packed GGUF weights). They account for 22 failures, most recently on #20071's staging run. Each one was judged separately:

Test Failure Which side is wrong
test_runtime_text_encoding.py::test_shipping_code_names_an_encoding unsloth/models/gguf_packed.py:1237 and :1243 open model.safetensors.index.json and config.json for writing without an encoding The code. The repo rule is that shipping text I/O names utf-8, so the Windows locale cannot decide.
test_optimized_precision_conflicts.py (20 cases) from_pretrained reached from .gguf_packed import check_gguf_packed_request: stub it in the loader fixture The test. FastLanguageModel.from_pretrained now validates a gguf_packed request at its entry point, which is correct. The fixture's relative-import guard did its job and named the missing binding.
test_offloaded_parameter_hint.py::test_both_save_failure_paths_use_it assert 3 == 2 The test. #20022 added a third GGUF save failure path (the packed dense write), and it correctly carries the offloaded-parameter hint. The test pinned the call count instead of the property.

Changes

  • unsloth/models/gguf_packed.py: both JSON writes in the dense writer pass encoding = "utf-8".
  • Loader fixture:
    • It binds the real check_gguf_packed_request, compiled from source like gguf_drop_bitsandbytes, instead of a stub.
    • _real_function now brings along the module-level literal constants the function reads (GGUF_PACKED_KWARG here). Without that, the real function would fail on a NameError.
    • New test test_the_real_gguf_packed_check_runs_at_the_entry_point: gguf_packed = True without a gguf_file is refused with a ValueError before any config probe or dispatch. This proves the real check runs, rather than a stub that always says "off".
  • Hint test: test_every_save_failure_path_uses_it walks every raise RuntimeError(f"Failed to save...") in save.py. It requires each message to include _offloaded_parameter_hint(...), and requires both the merge and the plain-save messages to still exist. A new failure path then has to carry the hint, whatever the count.

Verification

  • On main these three files have 22 failures. With this change they pass (44 passed).
  • Sabotage checks:
    • Dropping the hint from the GGUF-packed failure path fails the new hint test, which names line 5590.
    • Replacing the real check with lambda kwargs, **flags: False in the fixture fails test_the_real_gguf_packed_check_runs_at_the_entry_point.
    • Removing encoding = "utf-8" is the state on main, which the encoding guard reports.

…acked check in the loader fixture, hint check per failure path (red on main since #20022)
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T00:17:17.705285Z b3790bc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: b3790bcd6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 7c3ed8e into main Nov 28, 2026
4 of 63 checks passed
@danielhanchen
danielhanchen deleted the ci-gguf-packed-followups branch November 28, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant